const Sequelize = require('sequelize');
const sequelize = require('./index');
const User = require('./user');
const MysteryBox = require('./mysteryBox');

const Recommendation = sequelize.define('recommendation', {
  id: {
    type: Sequelize.INTEGER,
    primaryKey: true,
    autoIncrement: true
  },
  reason: {
    type: Sequelize.TEXT,
    allowNull: false
  }
});

// 关联
Recommendation.belongsTo(User);
Recommendation.belongsTo(MysteryBox);

module.exports = Recommendation;